<!DOCTYPE html>
<html>
<#include "../include/resource.html"> 
<body>
<#assign nid="borrow">
<#include "../include/header.html">

<link href="${request.getContextPath()}${theme_dir}/media/css/borrow_new.css" rel="stylesheet" type="text/css" />
<div id="main" class="clearfix">
<br/>
<#if type=="">
<div class="wrap950 list_1">
	<div class="borrow_box">
		<div><strong>发布按月借款</strong></div>
		<div>按等额本息法进行计算</div>
		<div align="center"><a href="/publish/index.html?type=month"><img src="{$tpldir}/images/borrow_yue.jpg" align=""/></a></div>
	</div>
	
	<div class="borrow_box">
		<div><strong>发布按季借款</strong></div>
		<div>按等额本息法进行计算</div>
		<div align="center"><img src="{$tpldir}/images/borrow_ji.jpg" align=""/></div>
	</div>
	
	<div class="borrow_box">
		<div><strong>发布担保借款</strong></div>
		<div>按等额本息法进行计算</div>
		<div align="center"><a href="/publish/index.html?type=vouch"><img src="{$tpldir}/images/borrow_danbao.jpg" align=""/></a></div>
	</div>
</div>

<#else>
<#if type=="vouch">

</#if>
	
<!--子栏目 开始-->
<div class="wrap950 header_site_sub">
	<#if type=="vouch">
	<div class="alert alert-error fade in">
	 <a class="close" data-dismiss="alert" href="#">&times;</a>
	<font color="#FF0000">您正在借的是担保标，担保标将先由有担保额度的用户进行担保，等担保额度满了自动会进行投标</font></div>
	</#if>
</div>
<!--子栏目 结束-->
<form name="form1" method="post" id="form1" action="<#if borrow?exists>update.html?id=${borrow.id?c}<#else>add.html</#if>"  enctype="multipart/form-data" onsubmit="return check_form();" >
<!--借款信息 开始-->


<ul  id="tab" class="list-tab clearfix">
		<li class="active"><a href="#jkxx" data-toggle="tab">借款信息</a></li>
		<#if type!="miaobiao" ><li><a href="#tbjl" data-toggle="tab">投标奖励</a></li></#if>
		<#if type=="vouch"><li><a href="#dbjl" data-toggle="tab">担保奖励</a></li></#if>
		<li><a href="#zhxx" data-toggle="tab">帐户信息公开设置</a></li>
		<!--<li><a href="#jkxq" data-toggle="tab">投标的详细说明</a></li>-->
</ul>

<div id="myTabContent" class="tab-content">


<div class="wrap950 list_1 tab-pane fade in active" id="jkxx">
	<div class="content">
	
			<div class="module_border">
			<div class="w">借贷总金额：</div>
			<div class="c">
					<span id="infojdmoney" data-content="借款金额应在500元至5,000,000元之间。交易币种均为人民币。借款成功后, 每个月按借款本金收取 
                            <#if type=="miaobiao"> 0元 
                            <#elseif type=="jinbiao"> 0.2%
                            <#else>0.5 % </#if>,管理费用不计息，不退还，在借款金额中直接扣除。 更详尽的信息请查看帮助网站 收费规则">
                            <input type="text" name="account"  id="account" value="<#if borrow?exists>${borrow.account}</#if>" onkeyup="value=value.replace(/[^0-9]/g,'')" /> 
							</span>
			</div>
			<div class="w">年利率：</div>
			<div class="c">
				<input type="text" name="apr" id="infonlv" data-content="填写您提供给投资者的年利率,所填写的利率是您还款的年利率。1至6个月的年利率不能超过24.38%,7至12个月的年利率不能超过26.18%.范围：1%至26.18%，且只保留小数后最后两位。" value="<#if borrow?exists>${borrow.apr}</#if>" onkeyup="value=value.replace(/[^0-9.]/g,'')" /> % 
			</div>
		</div>
	
	
		<div class="module_border">
			<div class="w">借款用途：</div>
			<div class="c"  >
				<span id="infojkxx" data-content="说明借款成功后的具体用途">
				<#if borrow?exists>
				<@linkage name="use" id="use" class="test" default="${borrow.use}" nid="borrow_use" />
				<#else>
				<@linkage name="use" id="use" class="test" nid="borrow_use" />
				</#if>
				</span>
			</div>
			
			<div class="w">借款期限：</div>
			<div class="c">
<#if type=='miaobiao'>
<span id="infomb" data-content="需要借多少时间。">
<#if borrow?exists>
<@linkage name="time_limit" id="time_limit" default="${borrow.time_limit}" type="value" nid="borrow_time_limit" disabled="disabled"/>
<#else>
<@linkage name="time_limit" id="time_limit" type="value" nid="borrow_time_limit"/>
</#if>
</span>
<#else>
<span id="infotl" data-content="需要借多少时间。">
<span id="time_limit">
<#if borrow?exists>
<@linkage name="time_limit" id="time_limit" default="${borrow.time_limit}" type="value" nid="borrow_time_limit" disabled="disabled"/>
<#else>
<@linkage name="time_limit" id="time_limit" type="value" nid="borrow_time_limit"/>
</#if>
</span></span>
<span id="time_limit_day" style="display:none;">
			<select name="time_limit_day" id="time_limit_day" ><option value="1">1天</option><option value="2">2天</option><option value="3">3天</option><option value="4">4天</option><option value="5">5天</option><option value="6">6天</option><option value="7">7天</option><option value="8">8天</option><option value="9">9天</option><option value="10">10天</option><option value="11">11天</option><option value="12">12天</option><option value="13">13天</option><option value="14">14天</option><option value="15">15天</option><option value="16">16天</option><option value="17">17天</option><option value="18">18天</option><option value="19">19天</option><option value="20">20天</option><option value="21">21天</option><option value="22">22天</option><option value="23">23天</option><option value="24">24天</option><option value="25">25天</option></select>
</span>
<a href="#">按天</a>
 <input type="checkbox" name="changetoDay"   value="1"  id="changetoDay" onclick="">  
</#if>				
			</div>
			
			
		</div>

		<div class="module_border" id="borrow_day" style="display:none;">
			<div class="w">是否天标：</div>
			<div class="c"><input type="hidden" name="isday" id="isday" value="0" />是
 

			</div>
			<div class="sco" style="color:#FF0000" >借款成功后，系统将按照每月30天来计算借款利息。<a href="/gonggao/a244.html" target="_blank">天标系统说明</a></div>
		</div>	
    	
<#if type=='miaobiao'>
		<div class="module_border">
			<div class="w">是否秒标：</div>
			<div class="c">
			<input type="hidden" name="is_mb" value="1" />
			<select name="miaobiao" disabled="disabled"><option value="1">是</option><option value="0">否</option></select>
			</div>
			<div class="sco" style="color:#FF0000" >借款成功后，系统立即扣除一个月的利息，并自动进行还款操作</div>
		</div>
</#if>				

<#if type=='fast'>		
		<div class="module_border">
			<div class="w">是否给力标：</div>
			<div class="c">
			<input type="hidden" name="is_fast" value="1" />
			<input type="hidden" name="fastid" value="{$fastid}" />
			<select name="fastbiao" disabled="disabled"><option value="1">是</option><option value="0">否</option></select>
			</div>
			<div class="sco" style="color:#FF0000" ><span id="infogeili" data-content="给力借款标显示标记“力”，是${Application.webname}网站经过严格核查借款人资产负债，根据借款人的信用状况，签订抵押担保手续，确保风险控制在合理的范围内。如借款人到期还款出现困难，借款到期日当天由${webname}垫付本金和利息还款，债权转让为${webname}网站所有，给力标逾期后，每天按千分之八收取罚息，本金利息及罚息全部为${webname}网站收取.">给力借款标显示标记“力”，是${webname}网站经过严格核查借款人资产负债，根据.....</span></div>
		</div>
</#if>				

<#if type=='jin'>
		<div class="module_border">
			<div class="w">是否净资产标：</div>
			<div class="c">
			<input type="hidden" name="is_jin" value="1" />
			<select name="jinbiao" disabled="disabled"><option value="1">是</option><option value="0">否</option></select>
			</div>
			<div class="sco" style="color:#FF0000" >净资产借款标显示标记“净”.</div>
		</div>
</#if>				
<#if type=='art'>
		<div class="module_border">
			<div class="w">是否文化艺术品标：</div>
			<div class="c">
			<input type="hidden" name="is_art" value="1" />
			<select name="jinbiao" disabled="disabled"><option value="1">是</option><option value="0">否</option></select>
			</div>
		</div>
</#if>
<#if type=='month'>
		<div class="module_border">
			<div class="w">是否信用标：</div>
			<div class="c">
			<input type="hidden" name="is_xin" value="1" />
			<select name="jinbiao" disabled="disabled"><option value="1">是</option><option value="0">否</option></select>
			</div>
		</div>
</#if>	
<#if type=='charity'>
		<div class="module_border">
			<div class="w">是否慈善标：</div>
			<div class="c">
			<input type="hidden" name="is_charity" value="1" />
			<select name="jinbiao" disabled="disabled"><option value="1">是</option><option value="0">否</option></select>
			</div>
		</div>
</#if>	
<#if type=='project'>
		<div class="module_border">
			<div class="w">是否项目标：</div>
			<div class="c">
			<input type="hidden" name="is_project" value="1" />
			<select name="jinbiao" disabled="disabled"><option value="1">是</option><option value="0">否</option></select>
			</div>
		</div>
</#if>	



<div class="module_border">
			<div class="w">是否定向标：</div>
			<div class="c">
                            <span id="infoisDXB" data-content="定向标可邀请特定的用户或朋友来投标，设置好密码后，告诉对方此标的密码即可." >
                            <input type="checkbox" name="isDXB" id="isDXB" value="1" autocomplete="off" <#if borrow?exists && borrow.pwd?exists>checked="checked"</#if> onclick="checkDXB()">  </span>
			</div>
                        <div class="w">定向标密码：</div>
			<div class="c">
                            <span id="infopwd" data-content='定向标密码可以是数字或文字。如"恭喜发财","生日快乐"等等 ' >
                            <input <#if !borrow?exists || !borrow.pwd?exists>disabled="disabled"</#if> type="text" name="pwd" id="pwd" value="<#if borrow?exists>${borrow.pwd}</#if>"></span>
			</div>
		</div>

		
		<div class="module_border">
			<div class="w">最低投标金额：</div>
			<div class="c">
				
					<span id="infolow" data-content="允许投资者对一个借款标的投标总额的限制">
					<#if borrow?exists>
					<@linkage name="lowest_account" id="lowest_account" default="${borrow.lowest_account}" nid="borrow_lowest_account"  type="value"/>
					<#else>
					<@linkage name="lowest_account" id="lowest_account" nid="borrow_lowest_account" type="value" />
					</#if>
					</span>
			</div>
			<div class="w">最多投标总额：</div>
			<div class="c">
			<span id="infomax" data-content="允许投资者对一个借款标的投标总额的限制">
			<#if borrow?exists>
			<@linkage name="most_account" id="most_account" default="${borrow.most_account}" nid="borrow_most_account" type="value" />
			<#else>
			<@linkage name="most_account" id="most_account" nid="borrow_most_account" type="value" />
			</#if>
			</span>
			</div>
		</div>
	
		
		<div class="module_border">
			<div class="w">有效时间：</div>
			<div class="c">
			<span id="infoyxtime" data-content="设置此次借款融资的天数。融资进度达到100%后直接进行网站的复审">
			<#if borrow?exists>
			<@linkage name="valid_time" id="valid_time" default="${borrow.valid_time}" nid="borrow_valid_time" />
			<#else>
			<@linkage name="valid_time" id="valid_time" nid="borrow_valid_time" />
			</#if>
			</span>
			</div>
			<div class="w">还款方式：</div>
			<div class="c">
				<span id="infohk" data-content="按月分期还款是指贷款者借款成功后，每月还本息。">
				<#if borrow?exists>
				<@linkage name="style" id="style" default="${borrow.style}" nid="borrow_style" type="value" />
				<#else>
				<@linkage name="style" id="style" nid="borrow_style" type="value" />
				</#if>
				</span>
			</div>
		</div>
		
	</div>
	<div class="foot"></div>
</div>
<!--借款信息 结束-->

<#if type=='miaobiao'>

<#else>
<!--投标奖励 开始-->
<div class="wrap950 list_1 tab-pane fade" id="tbjl"">
	<div class="content">
	<div class="module_border">
			<div class="w"><span id="infowjiang" data-content="如果您设置了奖励金额，将会冻结您帐户中相应的账户余额。如果要设置奖励，请确保您的帐户有足够 的账户余额。"><input type="radio" name="award" id="award" value="0" {if $var.award==0 || $var.award==""} checked="checked"{/if} onclick="change_j(0)">不设置奖励&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
			<div class="c"></div>
		</div>
		<div class="module_border">
			<div class="w"><span id="infoyjiang2" data-content="范围：0.1%~6% ，这里设置本次标的要奖励给所有投标用户的奖励比例。">
			<input type="radio" name="award" id="award" value="1" <#if borrow?exists &&borrow.award?exists && borrow.award==1>checked="checked"</#if> onclick="change_j(1)"/>按投标金额比例奖励：</span></div>
			<div class="c">
				<input type="text" id="part_account" name="part_account" value="<#if borrow?exists && borrow.part_account?exists >${borrow.part_account}</#if>" <#if borrow?exists &&borrow.award?exists && borrow.award==2>disabled="disabled"</#if> size="5" />%  
			</div>
			<div class="w"><span id="infoyjiang1" data-content="不能低于5元,不能高于总标的金额的2%，且请保留到“元”为单位。这里设置本次标的要奖励给所有投标用户的总金额。">
			<input type="radio" name="award" id="award" value="2" <#if borrow?exists &&borrow.award?exists && borrow.award==2>checked="checked"</#if> onclick="change_j(2)"/>按固定金额分摊奖励：</span></div>
			<div class="c">
				<input type="text" id="funds" name="funds" value="<#if borrow?exists && borrow.funds?exists>${borrow.funds}</#if>" <#if borrow?exists &&borrow.award?exists && borrow.award==1>disabled="disabled"</#if> size="5" />元
			</div>
		</div>
		
		
		
		
	
	</div>
	<div class="foot"></div>
</div>
<!--投标奖励 结束-->
</#if>

<#if type=='vouch'>
<!--担保奖励 开始-->
<div class="wrap950 list_1 tab-pane fade" id="dbjl">
	<div class="content">
		<div class="module_border">
			<div class="w">担保比例：</div>
			<div class="c">
			<input name="vouch_award" id="infodbbl" data-content="担保奖励按照所要借款的百分比给担保人，比如借100，奖励是3%，担保人借出50，则奖励50*3%=1.5" type="text" value="<#if borrow?exists>${borrow.vouch_award}</#if>" size="6" />%
			</div>
			<div class="w">指定担保人：</div>
			<div class="c">
			<input name="vouch_user" type="text" id="infodbb2" data-content="指定多个担保人请用|隔开，为空表示所有人都可以担保" value="<#if borrow?exists>${borrow.vouch_user}</#if>" /><input name="is_vouch" type="hidden" value="1" />
			</div>
		</div>
	</div>
	<div class="foot"></div>
</div>
<!--担保奖励 结束-->
</#if>

<!--帐户信息公开设置 开始-->
<div class="wrap950 list_1 tab-pane fade" id="zhxx">
	<div class="content">
		<div class="module_border">
			<div class="w"><span id="infoss1" data-content="如果您勾上此选项，将会实时公开您帐户的：账户总额、可用余额、冻结总额。">公开我的帐户资金情况<input type="checkbox" name="open_account" value="1" checked="checked" disabled="disabled"/></span> </div>
			<div class="c"></div>
			<div class="w"><span id="infoss1" data-content="如果您勾上此选项，将会实时公开您帐户的：借款总额、已还款总额、未还款总额、迟还总额、逾期总额。">公开我的借款资金情况<input type="checkbox" name="open_borrow" value="1" checked="checked" disabled="disabled"/></span></div>
			<div class="c"></div>
		</div>
		
		<div class="module_border">
			<div class="w"><span id="infoss1" data-content="如果您勾上此选项，将会实时公开您帐户的：投标总额、已收回总额、待收回总额。">公开我的投标资金情况<input type="checkbox" name="open_tender" autocomplete="off" value="1" <#if borrow?exists &&borrow.open_tender?exists && borrow.open_tender=="1">checked="checked"</#if>/></span></div>
			<div class="c"></div>
			<div class="w">
				<span id="infoss1" data-content="如果您勾上此选项，将会实时公开您帐户的：最低信用额度、最高信用额度。">公开我的信用额度情况 <input type="checkbox" name="open_credit" value="1" checked="checked" disabled="disabled"/></span></div>
			<div class="c"></div>
		</div>
	
	</div>
	<div class="foot"></div>
</div>
</div> <!-- myTabContent -->
<!--帐户信息公开设置 结束-->
<br/>
<!--帐户信息公开设置 开始-->
<ul  id="tab2" class="list-tab clearfix">
		<li class="active"><a href="#tbxx" data-toggle="tab2">投标的详细说明</a></li>
</ul>
<div id="myTabContent" class="tab-content">

<div class="wrap950 list_1 tab-pane fade in active" id="tbxx">
	<div class="content">
		<div class="module_border">
			<div class="w">标题：</div>
			<div style="padding-top:6px;">
				<input type="text" name="name" value="<#if borrow?exists>${borrow.name}</#if>" size="50" id="infotitle" data-content="填写借款的标题，写好一点能借的几率也大一点" /> 
			</div>
			<div class="sco" ></div>
		</div>
		 <script charset="utf-8" src="${request.getContextPath()}/plugins/editor/kindeditor/kindeditor-min.js"></script>
		<script charset="utf-8" src="${request.getContextPath()}/plugins/editor/kindeditor/lang/zh_CN.js"></script>	
		<div class="module_border">
			<div class="w">信息：</div>
			<div >
				<textarea name="content" id="content" style="width:700px;height:200px;visibility:hidden;" >
<#if borrow?exists>
${borrow.content}
<#else>
<P>借款详情： </P>
<P>站内关联用户名：</P>
<P>还款保障：</P>
</#if>
</textarea>
			</div>
		</div>
		<div class="module_border">
			<div class="w">验证码：</div>
			<div style="padding-top:6px;">
				<input name="valicode" type="text" size="11" maxlength="5" style="float:left" tabindex="3"/> &nbsp;&nbsp;&nbsp; 
				<img src="${request.getContextPath()}/validimg.html" alt="点击刷新"
					 onClick="this.src='${request.getContextPath()}/validimg.html?t=' + Math.random();"
					 align="absmiddle" style="cursor: pointer; float: left;" />
			</div>
			<div class="sco" ></div>
		</div>
	</div>
	<br/>
	<div class="content" style="text-align:center;">
		<input type="hidden" name="btype" value="${btype}" class="btn-action" />
		<input type="submit" value="确认提交" class="btn-action" />
	</div>
	<div class="foot"></div>
</div>

</div> <!-- myTabContent -->
<!--帐户信息公开设置 结束-->
<!--帐户信息公开设置 开始-->
</form>

</div>
<#if type=='miaobiao'>
<script>
alert("您正在发布的是秒标贷款，只要贷款成功立即自动还款");
</script>
</#if>



<script type="text/javascript">

				/*				
{article module="borrow" function="GetUserLog" user_id=0 var="acc"}

	var total_zi = ({$acc.total|default:0}-{$acc.no_use_money|default:0}-{$acc.wait_payment|default:0}-{$acc.borrowvouch_amount_useReal|default:0})*0.95;
        var jinMoney = ({$acc.total|default:0}-{$acc.no_use_money|default:0}-{$acc.wait_payment|default:0}-{$acc.borrowvouch_amount_useReal|default:0});
       //var total_zi = ({$acc.total|default:0}-{$acc.no_use_money|default:0}-{$acc.wait_payment|default:0})*0.95;

	var video_status = {$_G.user_result.video_status|default:0};
	var scene_status = {$_G.user_result.scene_status|default:0};
	var phone_status = {$_G.user_result.phone_status|default:0};
        var vip_status = {$_G.user_result.vip_status|default:0};
	var crmoney = {$acc.credit|default:0};
	var cr = {$_G.user_result.credit|default:0};
	var real_s = {$_G.user_result.real_status|default:0};
	var danbao_money = {$acc.borrow_vouch|default:0};
	var sxf = {$_G.system.con_borrow_fee*100};
	
	{if $magic.request.type=="vouch" || $var.is_vouch==1}
	alert("你的借款担保额度为{$acc.borrow_vouch}元,你还能借{$acc.borrow_vouch_use}元");
	var danbao = 1;
	var max_account = {$acc.borrow_vouch_use};
	{else}
	//alert("你的借款信用额度为{$acc.credit}元,你还能借{$acc.credit_use}元");
	var danbao = 0;
	var max_account = {$acc.credit_use};
	{/if}
{/article}

var max_fax ={$_G.system.con_max_fee|default:20};
var max_apr ={$_G.system.con_borrow_apr|default:22.18};

{if $fastbiao} var maxdai = 1000000000; var max_account=1000000000; var fastbiao = 1;{else} var maxdai=5000; var fastbiao = 0;{/if}

{if $miaobiao} var miaobiao_is = 1;{else} var miaobiao_is = 0;{/if}

{if $jinbiao} var jinbiao = 1;{else} var jinbiao = 0;{/if}

{literal}
 
 */
			var editor;
			KindEditor.ready(function(K) {
				editor = K.create('textarea[name="content"]', {
					resizeType : 1,
					allowPreviewEmoticons : false,
					allowImageUpload : false,
					items : [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
						'insertunorderedlist', '|', 'emoticons', 'image', 'link']
				});
			});
	 
								
			jQuery('#changetoDay').click(function(){

			var isday=jQuery('#isday').val();
		
			if(isday==0){
				jQuery('#isday').val('1');
				 
				jQuery('#time_limit_day').show();
				jQuery('#time_limit').hide();
			}else{
				jQuery('#isday').val('0');
				 
				jQuery('#time_limit_day').hide();
				jQuery('#time_limit').show();
			}

			jQuery('#borrow_day').toggle('slow');
			
								
			});
 




function checkDXB(){
    var frm = document.forms['form1'];
    if(frm.elements['isDXB'].checked){
        frm.elements['pwd'].disabled=false;
    }else{
        frm.elements['pwd'].disabled=true;
        frm.elements['pwd'].value="";
    }
}

function check_form(){
   
	 var frm = document.forms['form1'];
	 var account = frm.elements['account'].value;
	 var title = frm.elements['name'].value;
	 var style = frm.elements['style'].value;
	 var content = frm.elements['content'].value;
	 var time_limit = frm.elements['time_limit'].value;
	 var award = get_award_value();
	 var part_account = frm.elements['part_account'].value;
	 var funds = frm.elements['funds'].value;
	 var apr = frm.elements['apr'].value;
	 var valicode = frm.elements['valicode'].value;
	 var most_account = frm.elements['most_account'].value;
	 var use = frm.elements['most_account'].value;
	 var lowest_account = frm.elements['lowest_account'].value;
	
	 var errorMsg = '';
	  if (account.length == 0 ) {
		errorMsg += '- 总金额不能为空' + '\n';
	  }
	  
	  if(danbao){//担宝
              if(account > danbao_money){//如果大于担保额度,不允许
                  errorMsg += '- 您当前的贷款金额大于您的可用担保额度！' + '\n';
              }else if(cr < 30 || real_s != '1'){
                  errorMsg += '- 您尚未通过实名认证' + '\n';
                  alert(errorMsg);
                  location.href='/index.php?user&q=code/user/realname';
                  return false;
              }else if(vip_status != 1){
                            errorMsg += '-您不是VIP用户，请先申请VIP！' + '\n';
                            alert(errorMsg);
                            location.href="/vip/index.html";
                            return false;
              }else if(cr <30){
                  errorMsg += '- 您当前的积分小于30分，请上传资料进行认证!' + '\n';
                  alert(errorMsg);
                  location.href='/index.php?user&q=code/attestation';
                  return false;
              }//else if(video_status != '1' && scene_status != '1'){
                 // errorMsg += '- 您未进行视频认证或者现场认证，请先进行相关认证' + '\n';
                  //alert(errorMsg);
                  //location.href='/index.php?user&q=code/user/video_status';
                  //return false;
             // }
	      else if(account>(danbao_money)) errorMsg += '- 借款金额大于担保额度' + '\n';
	  }else if(miaobiao_is){//秒标
	  		//var donjie = parseFloat(apr)*parseFloat(account)/(100*12) + parseFloat(account)/100*sxf;//冻结资金
                        //var donjie = parseFloat(apr)*parseFloat(account)/(100*12);
	  		//if(parseInt(total_zi) < parseInt(donjie)) errorMsg += '- 您的账户总余额小于(利息+管理手续费的金额)' + '\n';
	  }else if(fastbiao){
	  		if(scene_status != '1'){
                          errorMsg += '- 您未进行现场认证，请先进行现场认证' + '\n';
                          alert(errorMsg);
                          location.href='/index.php?user&q=code/user/scene_status';
                          return false;
                        } 
	  		else if(account>5000000) errorMsg += '- 贷款总金额不能大于500万' + '\n';
                        
	  }else if(jinbiao){//净值标:账户总额减去冻结总额减去待还总额减去替人担保金额
       
              if(jinMoney < 500){
                            errorMsg += '-您的净资产小于500，不能发净资产标！' + '\n';
              }else if(account>jinMoney){
                            errorMsg += '-借款金额不能大于净资产！' + '\n';
              }else if(phone_status != '1'){
                          errorMsg += '- 您未进行手机认证，请先进行手机认证' + '\n';
                          alert(errorMsg);
                          location.href='/index.php?user&q=code/user/phone_status';
                          return false;
              }
              
          }else{//信用标:
	  		if(real_s != '1'){
                            errorMsg += '-请先通过实名认证！' + '\n';
                            alert(errorMsg);
                            location.href='/index.php?user&q=code/user/realname';
                            return false;
                        }else if(vip_status != 1){
                            errorMsg += '-您不是VIP用户，请先申请VIP！' + '\n';
                            alert(errorMsg);
                            location.href="/vip/index.html";
                            return false;
                        }else if(cr < 30 ){
                            errorMsg += '-您的积分小于30分,请上传资料进行认证！' + '\n';
                            alert(errorMsg);
                            location.href="/index.php?user&q=code/attestation";
                            return false;
                        }
                        ////else if(video_status != '1' && scene_status != '1'){
                          //errorMsg += '- 您未进行视频认证或者现场认证，请先进行相关认证' + '\n';
                          //alert(errorMsg);
                          //location.href='/index.php?user&q=code/user/video_status';
                          //return false;
                      // }

			else  if(account>max_account) errorMsg += '- 借款金额大于可用信用额度' + '\n';
	  }
	
	  if (apr.length == 0 ) {
		errorMsg += '- 利率不能为空' + '\n';
	  }
	  
	  if (time_limit >=1 && time_limit<=6 && apr>23.24) {
		errorMsg += '- 1至6个月的年利率不能超过23.24%' + '\n';
	  }else if (time_limit >6  && apr>25.24) {
		errorMsg += '- 6至12个月的年利率不能超过'+max_fax+'%' + '\n';
	  }
	  
	  if (apr<0 ||apr>max_apr) {
		errorMsg += '- 利率不能大于'+max_apr+'%' + '\n';
	  }
	  
	  if (award==1 && (part_account=="" || part_account<5 || part_account>account*0.02)) {
		errorMsg += '- 固定金额分摊奖励不能低于5元,不能高于总标的金额的2%' + '\n';
	  }
	  if (award==2 && (funds =="" || funds<0.1 || funds>6)) {
		errorMsg += '- 投标金额比例奖励0.1%~6% ' + '\n';
	  }
	  if (most_account!=0 && parseInt(most_account)<parseInt(lowest_account)){
		  errorMsg += '- 投标最大金额不能小于最小金额' + '\n';
	  }
	  if (title.length == 0 ) {
		errorMsg += '- 标题不能为空' + '\n';
	  }
	  if (content.length == 0 ) {
		errorMsg += '- 内容不能为空' + '\n';
	  }
	  if (valicode.length == 0 ) {
		errorMsg += '- 验证码不能为空' + '\n';
	  }

	
	var awa = "";
	for(var i=0;i<frm.award.length;i++){   
	   if(frm.award[i].checked){
		 awa =  frm.award[i].value;
		}
	} 


	if(awa==1){
		if (part_account==""){
			errorMsg += '- 固定分摊比例奖励不能为空 ' + '\n';
		}
	}
	if(awa==2){
		if (funds==""){
			errorMsg += '- 投标金额比例奖励不能为空 ' + '\n';
		}
	}
	
	  if (errorMsg.length > 0){
		alert(errorMsg); return false;
	  } else{  
		return true;
	  }

}
function get_award_value()
{
    var form1 = document.forms['form1'];
    
    for (i=0; i<form1.award.length; i++)    {
        if (form1.award[i].checked)
        {
           return form1.award[i].value;
        }
    }
}
function change_j(type){
	var frm = document.forms['form1'];
	if (type==0){
                jQuery("#part_account").attr("disabled",true); 
		jQuery("#funds").attr("disabled",true); 
                jQuery("#is_false").attr("disabled",true); 
                
                //frm.elements['part_account'].disabled = "disabled";
		//frm.elements['funds'].disabled = "disabled";
		//frm.elements['is_false'].disabled = "disabled";
	}else if (type==1){
                jQuery("#part_account").attr("disabled",false); 
		jQuery("#funds").attr("disabled",true); 
                jQuery("#is_false").attr("disabled",false); 
                
		//frm.elements['part_account'].disabled = "";
		//frm.elements['funds'].disabled = "disabled";
		//frm.elements['is_false'].disabled = "";
	}else if (type==2){
            
                jQuery("#part_account").attr("disabled",true); 
		jQuery("#funds").attr("disabled",false); 
                jQuery("#is_false").attr("disabled",false); 
                
		//frm.elements['part_account'].disabled = "disabled";
		//frm.elements['funds'].disabled = "";
		//frm.elements['is_false'].disabled = "";
	}
}	

 
</script>

</#if>
<script src="${request.getContextPath()}${theme_dir}/media/js/modal.js"></script>
<script src="${request.getContextPath()}${theme_dir}/media/js/tab.js"></script>
<script src="${request.getContextPath()}${theme_dir}/media/js/tooltip.js"></script>
<script src="${request.getContextPath()}${theme_dir}/media/js/popover.js"></script>
<script src="${request.getContextPath()}${theme_dir}/media/js/alert.js"></script>
<script src="${request.getContextPath()}${theme_dir}/media/js/transition.js"></script>

<#include "../include/footer.html"> 
